function [] = writeChangesToFile( filename, changesString, writeAction )
    %writeAction: 'w' for overwrite, 'a' for append
    
    fid = fopen( filename, writeAction );
    for i = 1:size(changesString,1)
        fprintf(fid, '%s \r\n', changesString{i} );
    end
    status = fclose(fid);
    if status == -1
        error( 'File not closed properly')
    end
end